package de.slothsoft.wasbinich.swingclient.table;

import java.util.ArrayList;
import java.util.List;

import de.slothsoft.wasbinich.core.FullPicture;
import de.slothsoft.wasbinich.core.database.Database;
import de.slothsoft.wasbinich.core.database.DatabaseException;

public class DefaultPictureTableModel extends AbstractPictureTableModel {

    private static final long serialVersionUID = 1739567065079359642L;

    public void refresh() throws DatabaseException {
	setList(fetchPictures());
    }

    private static List<FullPicture> fetchPictures() throws DatabaseException {
	return new ArrayList<FullPicture>(Database.getInstance().getManagerBean().getPictures());
    }
}
